#include "CLevelCell.h"

unsigned int CLevelCell::s_CellSize = 0;
bool CLevelCell::s_IsCellSizeInit = false;

void CLevelCell::initCellSize(uint cellSize)
{
	if(!s_IsCellSizeInit)
	{
		s_CellSize = cellSize;
		s_IsCellSizeInit = true;
	}
}

unsigned int CLevelCell::getCellSize()
{
	return s_CellSize;
}

CLevelCell::CLevelCell(SGameComponents &gamePointers, IMesh *basicMesh, 
	uint cellSize = 100)
{
	if(!s_IsCellSizeInit)
		initCellSize(cellSize);

	m_sGamePointers = gamePointers;
	m_pSceneManager = (ISceneManager *)gamePointers.SceneManager;

	m_eCurrentState = ECS_FLOOR;
	m_pLevelCellNode = m_pSceneManager->addMeshSceneNode(basicMesh);
}

bool CLevelCell::setNewState(ECellState newState)
{
	if(newState < ECS_COUNT && (true))
	{
		m_eCurrentState = newState;
		return true;
	}
	return false;
}

CLevelCell::~CLevelCell()
{
	m_pSceneManager->drop();
}
